package cn.edu.scau.cmi.youbaiquan.composite.safe;

import java.util.ArrayList;

public class SafeDepartment implements SafeComponent {

	private ArrayList<SafeComponent> children = new ArrayList<>();
	private String name = null;
	
	public SafeDepartment(String name) {
		this.name = name;
	}
	
	public boolean add(SafeComponent c) {
		return children.add(c);
	}
	
	public boolean remove(SafeComponent c) {
		return children.remove(c);
	}
	
	public ArrayList<SafeComponent> getChild() {
		return children;
	}
	
	@Override
	public String operation() {
		return this.toString() + "——开始签到打卡";
	}
	
	@Override
	public String toString() {
		return this.name;
	}

}
